package com.example.r2022913.service.WxService.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.r2022913.model.dao.WxDao.TypeDao;
import com.example.r2022913.model.entity.WxEntity.TypeEntity;
import com.example.r2022913.service.WxService.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.Map;

@Service
public class TypeServiceImpl extends ServiceImpl<TypeDao, TypeEntity> implements TypeService {
    @Autowired
    TypeDao typeDao;

    @Override
    public IPage typeList(Integer pageNum, Integer pageSize, Map<String, Object> params) {
        Page pageWc = new Page(pageNum, pageSize);
        IPage<TypeEntity> page = this.page(pageWc, null);
        return page;
    }

    @Override
    public Integer typeCount() {
        return typeDao.selectCount(null);
    }

    @Override
    public TypeEntity typeById(Long typeId) {
        return typeDao.selectById(typeId);
    }
}
